package com.struts.web.manage.admin.system;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import com.lg.system.CLGAction;
import com.lg.system.MessageBean;
import com.struts.deal.admin.system.SysDeal;
import com.struts.web.user.manage.system.EditPassForm;

public class EditPassAction extends CLGAction {

	
	public ActionForward execute(ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
		EditPassForm aWebForm = (EditPassForm)actionForm;
		ActionMessages msgs = new ActionMessages();
		MessageBean messageBean = new MessageBean();
		
		messageBean = SysDeal.modiPass(request, response, aWebForm);
		if(messageBean.isResult()){
			return actionMapping.findForward("nbsuccess");
		}else{
			msgs.add("commonMsgs",new ActionMessage(messageBean.getMessage()));
			saveErrors(request,msgs);
			return actionMapping.findForward("nbfail");
		}
		
	 }
}
